package com.qc.entity;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.List;

import com.qc.common.DateUtil;
import com.qc.entity.info.ListInfo;

public class UserSecScheduleEntity extends ListInfo {

	protected long ssId;//自增长
	
	//商家id
	private long shopId;
	
	private String image;//商家发布的封面图
	
	//商家一级分类id
	private long bCategoryOneId;
	
	//商家二级分类id
	private long bCategoryTwoId;
		
	protected String coverUrl;//封面图
	protected String title;//主题
	protected String shopMark;//地点标示
	protected String shopProvince;//省
	protected String shopCity;
	protected String shopDistrict;//区
	protected String shopAddress;//具体地址
	protected double shopLatitude;//纬度
	protected double shopLongitude;//经度
	protected String tag;
	protected String ssContent;
	protected double money;//每天金额
	protected int readCount;//阅读数
//	@JsonSerialize(using = CustomTimestampSerializer.class)
//	@JsonDeserialize(using =CustomTimestampDeserializer.class)
	protected String createdTime;
	
	private String avatar;//用户头像
	private String nickname;//用户昵称
	
	//是否接单状态 0 不接单  1 接单
	private int ordersState;
	
	protected int commentCount;//评论数量

	protected float grade;//评价
	
	protected int isFollowed;//是否关注 1/已关注
	
	//发布点赞数量
	private int pointNumber;
	
	//大于0 表示已点赞
	private int pointState;
	
	private String appId;
	private String modifiedTime;
	private String timestamp;
	private String noncestr;
	private String signature;
	private String content2;
	
	//分享使用时间
	private long time;
	
	//排行榜 状态  1 本周 2上周
	private int rankingState;
	
	
	//浏览记录
	private List<FootprintEntity> listFootprint;
	
	public static UserSecScheduleEntity getInstance(ResultSet rs) throws SQLException {
		UserSecScheduleEntity entity = new UserSecScheduleEntity();
		entity.setSsId(rs.getLong("ss_id"));
		entity.setUserId(rs.getLong("user_id"));
		entity.setCoverUrl(rs.getString("cover_url"));
		entity.setTitle(rs.getString("title"));
		entity.setShopMark(rs.getString("shop_mark"));
		entity.setShopProvince(rs.getString("shop_province"));
		entity.setShopCity(rs.getString("shop_city"));
		entity.setShopDistrict(rs.getString("shop_district"));
		entity.setMoney(rs.getDouble("money_day"));
		entity.setShopAddress(rs.getString("shop_address"));
		entity.setTag(rs.getString("tag"));
		entity.setSsContent(rs.getString("ss_content"));
		entity.setCreatedTime(rs.getTimestamp("created_time"));
		entity.setAvatar(rs.getString("avatar"));
		entity.setNickname(rs.getString("nickname"));
		entity.setReadCount(rs.getInt("read_count"));
		entity.setCommentCount(rs.getInt("comment_count"));
//		entity.setCommentCount(rs.getInt("comment_count"));
		entity.setShopLatitude(rs.getDouble("shop_latitude"));
		entity.setShopLongitude(rs.getDouble("shop_longitude"));
		entity.setPointNumber(rs.getInt("point_number"));
		
		try {
			entity.setCommentCount(rs.getInt("comment_count"));
		} catch (Exception e) {
			
		}
		try {
			entity.setGrade(rs.getFloat("grade"));
		} catch (Exception e) {
			
		}
		
		try {
			entity.setOrdersState(rs.getInt("orders_state"));
		} catch (Exception e) {
		}
		
		try {
			entity.setbCategoryOneId(rs.getLong("b_category_one_id"));
			entity.setbCategoryTwoId(rs.getLong("b_category_two_id"));
		} catch (Exception e) {
		}
		
		return entity;
	}
	public double getMoney() {
		return money;
	}
	public void setMoney(double money) {
		this.money = money;
	}
	public long getSsId() {
		return ssId;
	}
	public void setSsId(long ssId) {
		this.ssId = ssId;
	}

	public String getCoverUrl() {
		return coverUrl;
	}
	public void setCoverUrl(String coverUrl) {
		this.coverUrl = coverUrl;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getShopMark() {
		return shopMark;
	}
	public void setShopMark(String shopMark) {
		this.shopMark = shopMark;
	}
	public String getShopProvince() {
		return shopProvince;
	}
	public void setShopProvince(String shopProvince) {
		this.shopProvince = shopProvince;
	}
	public String getShopCity() {
		return shopCity;
	}
	public void setShopCity(String shopCity) {
		this.shopCity = shopCity;
	}
	public String getTag() {
		return tag;
	}
	public void setTag(String tag) {
		this.tag = tag;
	}
	public String getSsContent() {
		return ssContent;
	}
	public void setSsContent(String ssContent) {
		this.ssContent = ssContent;
	}
	public String getShopDistrict() {
		return shopDistrict;
	}
	public void setShopDistrict(String shopDistrict) {
		this.shopDistrict = shopDistrict;
	}
	public String getShopAddress() {
		return shopAddress;
	}
	public void setShopAddress(String shopAddress) {
		this.shopAddress = shopAddress;
	}

	public String getAvatar() {
		return avatar;
	}
	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}
	public String getNickname() {
		return nickname;
	}
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
	public String getCreatedTime() {
		return createdTime;
	}
	public void setCreatedTime(Timestamp createdTime) {

		this.createdTime = DateUtil.timestampParseString(createdTime);
	}
	public int getReadCount() {
		return readCount;
	}
	public void setReadCount(int readCount) {
		this.readCount = readCount;
	}
	public int getCommentCount() {
		return commentCount;
	}
	public void setCommentCount(int commentCount) {
		this.commentCount = commentCount;
	}
	public double getShopLatitude() {
		return shopLatitude;
	}
	public void setShopLatitude(double shopLatitude) {
		this.shopLatitude = shopLatitude;
	}
	public double getShopLongitude() {
		return shopLongitude;
	}
	public void setShopLongitude(double shopLongitude) {
		this.shopLongitude = shopLongitude;
	}
	public float getGrade() {
		return grade;
	}
	public void setGrade(float grade) {
		this.grade = grade;
	}
	public int getIsFollowed() {
		return isFollowed;
	}
	public void setIsFollowed(int isFollowed) {
		this.isFollowed = isFollowed;
	}
	public String getAppId() {
		return appId;
	}
	public void setAppId(String appId) {
		this.appId = appId;
	}
	public String getModifiedTime() {
		return modifiedTime;
	}
	public void setModifiedTime(String modifiedTime) {
		this.modifiedTime = modifiedTime;
	}
	public String getTimestamp() {
		return timestamp;
	}
	public void setTimestamp(String timestamp) {
		this.timestamp = timestamp;
	}
	public String getNoncestr() {
		return noncestr;
	}
	public void setNoncestr(String noncestr) {
		this.noncestr = noncestr;
	}
	
	public String getSignature() {
		return signature;
	}
	public void setSignature(String signature) {
		this.signature = signature;
	}
	public void setCreatedTime(String createdTime) {
		this.createdTime = createdTime;
	}
	public String getContent2() {
		return content2;
	}
	public void setContent2(String content2) {
		this.content2 = content2;
	}
	public long getShopId() {
		return shopId;
	}
	public void setShopId(long shopId) {
		this.shopId = shopId;
	}
	public List<FootprintEntity> getListFootprint() {
		return listFootprint;
	}
	public void setListFootprint(List<FootprintEntity> listFootprint) {
		this.listFootprint = listFootprint;
	}
	public long getbCategoryOneId() {
		return bCategoryOneId;
	}
	public void setbCategoryOneId(long bCategoryOneId) {
		this.bCategoryOneId = bCategoryOneId;
	}
	public long getbCategoryTwoId() {
		return bCategoryTwoId;
	}
	public void setbCategoryTwoId(long bCategoryTwoId) {
		this.bCategoryTwoId = bCategoryTwoId;
	}
	public int getOrdersState() {
		return ordersState;
	}
	public void setOrdersState(int ordersState) {
		this.ordersState = ordersState;
	}

	public String getImage() {
		return image;
	}
	public void setImage(String image) {
		this.image = image;
		
	}
	public long getTime() {
		return time;
	}
	public void setTime(long time) {
		this.time = time;
	}
	public int getPointNumber() {
		return pointNumber;
	}
	public void setPointNumber(int pointNumber) {
		this.pointNumber = pointNumber;
	}
	public int getPointState() {
		return pointState;
	}
	public void setPointState(int pointState) {
		this.pointState = pointState;
	}
	public int getRankingState() {
		return rankingState;
	}
	public void setRankingState(int rankingState) {
		this.rankingState = rankingState;
	}
	
	
}
